< previous page page_344 next page >

Page 344
Tutorial 6
C++ Variables Meet Visual Basic
As a Visual Basic programmer, you are hopefully familiar with the Visual Basic data types. Their characteristics are shown in Table T6-1.
TYPEBYTESSIGNRANGE
Byte1Unsigned0 to 255
Boolean2NATrue of False
Integer2Signed32768 to 32767
Long4Signed2147483648 to 2147483647
Single4Signed±1.4E-45 to ±3.4E38
Double8Signed±4.9E-324 to ±1.7E308
Currency8SignedSee VB docs
not applicable to API
Decimal14SignedSee VB docs
not applicable to API
Date8NASee VB docs
not applicable to API
Object4NA
String*NALength varies by string
Variant16NADepends on contained variable
User-Defined*Varies depending on definition
* = Varies
Table T6-1: Characteristics of Visual Basic data types

C Data Types
When a Visual Basic programmer first looks at a C/C++ declaration, it can be more than a little bit intimidating.1 The C language seems to have billions of different data types. How can you possibly figure out a Visual Basic equivalent for each one?

 
< previous page page_344 next page >